<?php
	include_once("king_head.php");	
?>
<CENTER>
<H2> Manage Logos</H2>
<FORM METHOD=POST enctype="multipart/form-data" ACTION="Managelogos.php?site_id=<?php echo $_SESSION['SITE_ID']?>&upld=1">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="69%" id="AutoNumber1">
	<?php
		$imgcnt=0;
		$hnd=opendir("./logoclips");
		while($file=readdir($hnd))
		{
			$imgcnt++;
		//	$flag=strcmp($file$clogo);
			$ext=substr($file, -3,3);
			if($ext=="jpg" || $ext=="gif")	
			{		
					print("<tr><td width=\"26%\"><img border=\"2\" style=\"border-color:Gray\" src=\"logoclips/".$file."\" width=\"50\" height=\"50\" width=\"59\" height=\"56\"></td>");		
					echo "<td width=\"74%\"><a href=\"logodel.php?file=".$file."&site_id=".$_SESSION['SITE_ID']."\">Delete This Logo</a></td></tr>";
			}		
	
		}
		closedir($hnd);
		?>    
  
  <tr>
    <td width="26%"><b>Select a new Logo</b></td>
    <td width="74%">&nbsp;<input type="file" name="logofile" size="29"></td>
  </tr>
  <tr>
    <td width="26%">&nbsp;</td>
    <td width="74%">&nbsp;<input type="submit" value="Upload Logo" name="B1"></td>
  </tr>
  <?php
	$uploaddir = "./logoclips"; 
	$logofile=$_FILES['logofile']['name'];
	//echo $logofile;
			$newfile=$logofile;
			//print($newfile."<BR>");
			if(is_uploaded_file($_FILES['logofile']['tmp_name']))
			{
				move_uploaded_file($_FILES['logofile']['tmp_name'],$uploaddir.'/'.$newfile);
			}
 ?>
</table>
</FORM>
<?php
if($upld==1)
	{?>
	<script type="text/javascript">
	window.location.assign('Managelogos.php?site_id=<?php echo $_SESSION['SITE_ID']?>&upld=0');
	</script>
	<?php } ?>
<CENTER>
<?php
	include_once("king_foot.php");
?>